﻿#parse("partials/header.html") #parse("partials/sidebar.html")
<script>
    jQuery(document).ready(function () {

        //jQuery("#formID").validate();

        jQuery("#mws-validate").submit(
            function () {
                if (jQuery("#mws-validate").valid() == true) {
                    jQuery.blockUI();
                    var post_data = jQuery(this).serialize();
                    var form_action = jQuery(this).attr("action");
                    var form_method = jQuery(this).attr("method");

                    jQuery.ajax({
                        type: form_method,
                        url: form_action,
                        cache: false,
                        dataType: "json",
                        data: post_data,
                        success: function (data) {
                            jQuery.unblockUI();
                            $("#notif").html(data.strNotification);
                            $("#Id").val(data.id);

                        },
                        error: function (data) {
                            jQuery.unblockUI();
                        },
                        complete: function () {
                            window.scrollTo(0, 0);

                        }
                    });
                }
                return false;
            });

        $("#ButtonSearchPresentArea").click(function () {
            OpenPopUpPresentArea();
        });

        //Popup Area
        function OpenPopUpPresentArea() {
            $("#HiddenIsPermanentAddress").val("0");
            $("#mws-form-dialog").dialog("open");
            $("#modalIframeForm").attr("src", rooturl + "home/popup/popupsearcharea");
            return false;
        }




    });


    function setAreaTextBox(AreaId, AreaName, CityId, CityName, CountryId, CountryName, ProvinceId, ProvinceName) {

        $("#AreaName").val(AreaName);
        $("#AreaId").val(AreaId);


        $("#CityId").val(CityId);
        $("#CityName").val(CityName);

        $("#ProvinceId").val(ProvinceId);
        $("#ProvinceName").val(ProvinceName);

        $("#CountryId").val(CountryId);
        $("#CountryName").val(CountryName);


        $('#modalIframeForm').attr('src', '');
        $("#mws-form-dialog").dialog("close");
    }
</script>
<div id="mws-container" class="clearfix">
    <div class="container">
        <form method="post" action="/master/suppliers/savesupplier" class="crud" id="mws-validate">
        <div class="mws-panel grid_8">
            <div class="mws-panel-header">
                <span class="mws-i-24 i-calendar-today">Supplier</span>
            </div>
            <div class="mws-panel-body">
                <div class="mws-panel-toolbar top clearfix">
                    <ul>
                        <li><a class="mws-ic-16 ic-arrow-left" href="/master/suppliers/" title="Accept">Back
                            Suppliers List</a></li>
                        <li><a class="mws-ic-16 ic-add" href="/master/suppliers/supplierprepaireforadd" title="Accept">
                            Add Supplier</a></li>
                        <li><a class="mws-ic-16 ic-add" href="/master/suppliertype/suppliertypeprepaireforadd"
                            title="Accept">Add Supplier Type</a></li>
                        <li><a class="mws-ic-16 ic-application-view-list" href="/master/suppliertype/" title="Accept">
                            Supplier Type List</a></li>
                    </ul>
                </div>
                <div id="notif">
                    $Notification
                </div>
                <div class="mws-form">
                    <div class="grid_4">
                        <div class="mws-form-inline">
                            <div class="mws-form-row">
                                <label>
                                    Code</label>
                                <div class="mws-form-item">
                                    <input type="hidden" value="$supplier.Id" name="Id" id="Id" />
                                    <input class="required text-input, lf mws-textinput" style="text-transform: uppercase;"
                                        id="CodeValue" name="CodeValue" type="text" value="$supplier.CodeValue" maxlength="30" />
                                </div>
                            </div>
                             <div class="mws-form-row">
                                <label>
                                    Company Name</label>
                                <div class="mws-form-item">
                                    <input class="required text-input, lf mws-textinput" id="NameValue" name="NameValue" type="text" value="$supplier.NameValue" maxlength="30" />
                                </div>
                            </div>
                            <div class="mws-form-row">
                                <label>
                                    ContactPerson</label>
                                <div class="mws-form-item">
                                    <input class="required text-input, lf mws-textinput" id="ContactPerson" name="ContactPerson"
                                        type="text" value="$supplier.ContactPerson" maxlength="30" />
                                </div>
                            </div>
                            <div class="mws-form-row">
                                <label>
                                    NPWP</label>
                                <div class="mws-form-item">
                                    <input class="required text-input, lf mws-textinput" id="NPWP" name="NPWP" type="text"
                                        value="$supplier.NPWP" maxlength="20" />
                                </div>
                            </div>
                            <div class="mws-form-row">
                                <label>
                                    Term Of Payment</label>
                                <div class="mws-form-item">
                                    <input class="required text-input, lf mws-textinput" id="TermOp" name="TermOp" type="text"
                                        value="$supplier.TermOp" />
                                </div>
                            </div>
                            <div class="mws-form-row">
                                <label>
                                    Phone</label>
                                <div class="mws-form-item">
                                    <input class="required text-input, lf mws-textinput" id="Phone" name="Phone" type="text"
                                        value="$supplier.Phone" maxlength="20" />
                                </div>
                            </div>
                            <div class="mws-form-row">
                                <label>
                                    Mobile</label>
                                <div class="mws-form-item">
                                    <input class="required text-input, lf mws-textinput" id="Mobile" name="Mobile" type="text"
                                        value="$supplier.Mobile" maxlength="20" />
                                </div>
                            </div>
                            <div class="mws-form-row">
                                <label>
                                    Fax</label>
                                <div class="mws-form-item">
                                    <input class="required text-input, lf mws-textinput" id="Fax" name="Fax" type="text"
                                        value="$supplier.Fax" maxlength="20" />
                                </div>
                            </div>
                            <div class="mws-form-row">
                                <label>
                                    VAT</label>
                                <div class="mws-form-item">
                                    <input class="required text-input, lf mws-textinput" id="VAT" name="VAT" type="text"
                                        value="$supplier.VAT" />
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="grid_4">
                        <div class="mws-form-inline">
                            <div class="mws-form-row">
                                <label>
                                    PPH23</label>
                                <div class="mws-form-item">
                                    <input class="required text-input, lf mws-textinput" id="PPH23" name="PPH23" type="text"
                                        value="$supplier.PPH23" />
                                </div>
                            </div>
                            <div class="mws-form-row">
                                <label>
                                    PPH24</label>
                                <div class="mws-form-item">
                                    <input class="required text-input, lf mws-textinput" id="PPH24" name="PPH24" type="text"
                                        value="$supplier.PPH24" />
                                </div>
                            </div>
                            <div class="mws-form-row">
                                <label>
                                    In Catalogue</label>
                                <div class="mws-form-item">
                                    <input class="required text-input, lf mws-textinput" id="InCatalogue" name="InCatalogue"
                                        type="text" value="$supplier.InCatalogue" />
                                </div>
                            </div>
                            <div class="mws-form-row">
                                <label>
                                    Bank Account</label>
                                <div class="mws-form-item">
                                    <input class="required text-input, lf mws-textinput" id="BankAccount" name="BankAccount"
                                        type="text" value="$supplier.BankAccount" />
                                </div>
                            </div>
                            <div class="mws-form-row">
                                <label>
                                    Bank Account Name</label>
                                <div class="mws-form-item">
                                    <input class="required text-input, lf mws-textinput" id="BankAccountName" name="BankAccountName"
                                        type="text" value="$supplier.BankAccountName" />
                                </div>
                            </div>
                            <div class="mws-form-row">
                                <label>
                                    Bank Branch</label>
                                <div class="mws-form-item">
                                    <input class="required text-input, lf mws-textinput" id="BankBranch" name="BankBranch"
                                        type="text" value="$supplier.BankBranch" />
                                </div>
                            </div>
                            <div class="mws-form-row">
                                <label>
                                    Supplier Type</label>
                                <div class="mws-form-item">
                                    $ddlSupplier
                                </div>
                            </div>
                            <div class="mws-form-row">
                                <label>
                                    Bank</label>
                                <div class="mws-form-item">
                                    $ddlBank
                                </div>
                            </div>
                        </div>
                    </div>
                    <br />
                    <hr />
                    <div class="grid_4">
                        <div class="mws-form-inline">
                            <div class="mws-form-row">
                                <label>
                                    Address</label>
                                <div class="mws-form-item">
                                    <input id="AddressDesc" name="AddressDesc" value="$viewDataAddress.AddressDesc" type="text"
                                        class="mws-textinput required" />
                                    <input type="hidden" id="AddressId" name="AddressId" value="$viewDataAddress.AddressId" />
                                </div>
                            </div>
                            <div class="mws-form-row">
                                <label>
                                    Area</label>
                                <div class="mws-form-item">
                                    <div class="mws-form-cols clearfix">
                                        <div class="mws-form-col-7-8 alpha">
                                            <div class="mws-form-item">
                                                <input id="AreaName" name="AreaName" value="$viewDataAddress.AreaName" type="text"
                                                    class="mws-textinput" readonly="readonly" />
                                                <input id="AreaId" type="hidden" name="AreaId" value="$viewDataAddress.AreaId" />
                                            </div>
                                        </div>
                                        <div class="mws-form-col-1-8">
                                            <div class="mws-form-item">
                                                <input type="button" class="mws-button green small ButtonSearchPresentArea" name="ButtonSearchPresentArea"
                                                    value="search" id="ButtonSearchPresentArea" />
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="mws-form-row">
                                <label>
                                    City</label>
                                <div class="mws-form-item">
                                    <input id="CityName" name="CityName" value="$viewDataAddress.CityName" type="text"
                                        class="mws-textinput" readonly="readonly" />
                                    <input id="CityId" type="hidden" name="CityId" value="$viewDataAddress.CityId" />
                                </div>
                            </div>
                            <div class="mws-form-row">
                                <label>
                                    Province</label>
                                <div class="mws-form-item">
                                    <input id="ProvinceName" name="ProvinceName" value="$viewDataAddress.ProvinceName"
                                        readonly="readonly" type="text" class="mws-textinput" />
                                    <input id="ProvinceId" name="ProvinceId" type="hidden" value="$viewDataAddress.ProvinceId" />
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="grid_4">
                        <div class="mws-form-inline">
                            <div class="mws-form-row">
                                <label>
                                    Country</label>
                                <div class="mws-form-item">
                                    <input id="CountryName" name="CountryName" value="$viewDataAddress.CountryName" type="text"
                                        class="mws-textinput" readonly="readonly" />
                                    <input id="CountryId" name="CountryId" type="hidden" value="$viewDataAddress.CountryId" />
                                </div>
                            </div>
                            <div class="mws-form-row">
                                <label>
                                    PIN/ZIP/Code</label>
                                <div class="mws-form-item">
                                    <input id="ZipCode" name="ZipCode" type="text" class="mws-textinput" value="$viewDataAddress.ZipCode"
                                        maxlength="10" />
                                </div>
                            </div>
                            <div class="mws-form-row">
                                <label>
                                    Phone Number</label>
                                <div class="mws-form-item large">
                                    <input id="PhoneNumber" name="PhoneNumber" type="text" class="mws-textinput digits"
                                        value="$viewDataAddress.PhoneNumber" maxlength="15" />
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="clear15">
                    </div>
                    <div class="mws-button-row">
                        <input name="btnAction" class="mws-button red" type="submit" value="Save" />
                        <input class="mws-button gray" type="reset" value="Reset" />
                    </div>
                </div>
            </div>
        </div>
        <hr />
        </form>
    </div>
#parse("partials/footer.html")